﻿using System;
using System.Collections.Generic;
using System.Text;

namespace VTemplate.Engine.Demo
{
    internal class Program
    {
        static void Main(string[] args)
        {
            var userList = new List<object> { new { Name = "张三", Age = 15 }, new { Name = "李四", Age = 16 }, new { Name = "王五", Age = 17 } };

            string path = AppDomain.CurrentDomain.BaseDirectory.Replace("\\", "/") + "test.html";
            TemplateDocument document = new TemplateDocument(path, Encoding.UTF8);
            document.Variables.SetValue("title", "测试");
            document.Variables.SetValue("users", userList);
            document.Variables.SetValue("age", 20);
            string result = document.GetRenderText();


            Console.WriteLine(result);
            Console.ReadLine();
        }
    }
}
